package com.sos.application
{
	
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	public class FlashApplicationErrorEvent extends FlashApplicationEvent
	{
		
		// -------------------------------------------------------------------------------
		// FIELDS
		// -------------------------------------------------------------------------------
		
		private var _error:Error;
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------

		/**
		 * Event that represent ena error occoured during the application execution 
		 * @param application Application
		 * @param message message related to the event
		 * @param error (optinal) Error object tha reaises the event
		 * 
		 */		
		public function FlashApplicationErrorEvent(message:String = "", error:Error = null)
		{
			super(FlashApplicationEvent.EVENT_ERROR, message);
			// Init
			_error = error;
		}
		
		// -------------------------------------------------------------------------------
		// PROPERTIES
		// -------------------------------------------------------------------------------
		
		public function get error():Error
		{
			return _error;
		}

		public function get hasError():Boolean
		{
			return _error != null;
		}

		
	}
}